import React,{useEffect}from 'react';
import { useNavigate } from 'react-router-dom';
import './Zhengce.scss'
import type { ColumnsType } from 'antd/es/table';
import {
    Button,
    Cascader,
    DatePicker,
    Form,
    Input,
    Table, Divider ,

    InputNumber,
    Radio,
    Select,
    Switch,
    TreeSelect,
} from 'antd';
const { RangePicker } = DatePicker;

interface Props {

}
interface DataType {
    key: React.Key;
    name: string;
    age: number;
    address: string;
  }
function Zhengce(props: Props) {
    const columns: ColumnsType<DataType> = [
        {
          title: '排序号',
          dataIndex: 'paixu',
        },
        {
          title: '标题',
          dataIndex: 'age',
        },
        {
          title: '发布单位',
          dataIndex: 'address',
        },
        {
          title: '发布时间',
          dataIndex: 'time',
        },
        {
          title: '状态',
          dataIndex: 'state',
        },
        {
          title: '操作人',
          dataIndex: 'men',
        },
        {
          title: '操作时间',
          dataIndex: 'fixtime',
        },
        {
          title: '操做',
          render: (_, record) => (
           <span>
             <Button size="middle">
              编辑   
            </Button>
             <Button size="middle">
              察看   
            </Button>
             <Button size="middle">
              删除   
            </Button>
            
           </span>
            
          ),
        },
      ];
      
      const data: DataType[] = [
        {
          key: '1',
          name: 'John Brown',
          age: 32,
          address: 'New York No. 1 Lake Park',
        },
        {
          key: '2',
          name: 'Jim Green',
          age: 42,
          address: 'London No. 1 Lake Park',
        },
        {
          key: '3',
          name: 'Joe Black',
          age: 32,
          address: 'Sydney No. 1 Lake Park',
        },
      ];
      var navgate=useNavigate()
      var tiao=()=>{
        navgate('/Xinzeng')

      }
    return (
        <div className='zhengce'>

            我是政策法规管理
            <div className='main'>
                <div className='top'>  <Form
                    labelCol={{ span: 4 }}
                    wrapperCol={{ span: 14 }}
                    layout="horizontal"
                    // onValuesChange={onFormLayoutChange}
                    style={{ maxWidth: 600 }}
                >
                    <Form.Item label="标题：">
                        <Input className='input' />
                    </Form.Item>
                </Form>
                    <span>发布时间：</span> <RangePicker className='piker' />

                </div>
                <p> <Button type="primary" >
                    查询
                </Button> <Button  >
                        重置
                    </Button>
              
                </p>

                <div className='biao'>
                <Button type="primary" onClick={tiao} >
                    新增
                </Button>
                <Table className='t1' columns={columns} dataSource={data} size="middle" />


                </div>

            </div>
        </div>
    );
}

export default Zhengce;